package com.turing.procedure.enums;


import lombok.Getter;

public enum TaskStatusEnum {

    PREPARED(0, "待开始"),
    PRETASKFINISHED(1, "预处理完成"),
    OCRFINISHED(2, "ocr完成"),
    WAITINGFORREVIEW(3, "等待审核"),
    REVIEWING(4,"审核完成"),
    REVIEWED(5,"审核完成"),
    FAILED(10, "任务失败");


    @Getter
    private Integer code;
    @Getter
    private String name;

    TaskStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;

    }

    public static TaskStatusEnum getEnum(Integer index) {
        TaskStatusEnum[] fileStatusEnums = TaskStatusEnum.values();
        for (TaskStatusEnum anFileStatusEnum : fileStatusEnums) {
            if (index.equals(anFileStatusEnum.getCode())) {
                return anFileStatusEnum;
            }
        }
        return null;
    }

}
